package 第13届;

import java.io.*;
import java.util.*;

public class G_数组切分_2148 {
	static List<Integer> sun;
	static int count = 0;
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		StringTokenizer st;
		int n = Integer.parseInt(br.readLine());
		int arr[] = new int[n];
		st = new StringTokenizer(br.readLine());
		
		for(int i = 0 ; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
		}
		
		backtracking(arr,0);
		
		
		System.out.println(count);
	}
	
	public static void backtracking(int arr[], int index) {
		List<Integer> item = new ArrayList<>();
		for(int i = index; i < arr.length; i++) {
			item.add(arr[i]);
			if(check(item)) {
				System.out.println(item);
				count++;
			}
			backtracking(arr, i + 1);
		}
		
	}
	
	public static boolean check(List<Integer> item) {
		sun = new ArrayList<Integer>(item);
		Collections.sort(sun);
		
		if(sun.size() > 1) {
			for(int i = 1; i < sun.size(); i++) {
				if(sun.get(i-1) + 1 != sun.get(i)) {
					return false;
				}
			}
		}
		
		return true;
	}
}
